<%--
  User: Katakuri
  Date: 2021/9/23
  Time: 21:09
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

%>
<html>
<head>
    <base href="<%=basePath %>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Insert title here</title>
</head>
<body>
<a href="${pageContext.request.contextPath}/user/logout">注销</a>
<h1>网站主页</h1>

<ul>
    用户：<shiro:principal/> 已登录！
    <shiro:user>

    </shiro:user>
    <shiro:hasAnyRoles name="admin,user">
        <li>用户管理
            <shiro:hasPermission name="user:create:*">
                <ul>添加</ul>
            </shiro:hasPermission>
            <shiro:hasPermission name="user:delete:*">
                <ul>删除</ul>
            </shiro:hasPermission>
            <shiro:hasPermission name="user:update:*">
                <ul>修改</ul>
            </shiro:hasPermission>
            <shiro:hasPermission name="user:query:*">
                <ul>查询</ul>
            </shiro:hasPermission>
        </li>
    </shiro:hasAnyRoles>
    <shiro:hasRole name="user">
        <li>商品管理</li>
        <li>物流管理</li>
        <li>拉拉管理</li>
    </shiro:hasRole>
</ul>
</body>
</html>
